package com.kly.user.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.google.common.collect.Maps;
import com.kly.user.db.dao.UserConversationNumDao;
import com.kly.user.db.entity.UserConversationNumEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;

/**
* User: linqu
* Date: 2023-10-27
* Time: 16:27:30.249
*/

@Repository
public class UserConversationNumDaoImpl extends AbstractBaseMapper<UserConversationNumEntity> implements UserConversationNumDao {

    @Override
    public UserConversationNumEntity getUserConversationNum(String chatterUserCode, String modelUserCode, Integer addConversationDate) {
        final HashMap<String, Object> params = Maps.newHashMap();
        params.put("chatterUserCode", chatterUserCode);
        params.put("modelUserCode", modelUserCode);
        params.put("addConversationDate", addConversationDate);
        return this.getSqlSession().selectOne(this.getStatement("getUserConversationNum"), params);
    }

    @Override
    public UserConversationNumEntity getUserConversationNumEntity(String chatterUserCode, Integer today) {
        final HashMap<String, Object> params = Maps.newHashMap();
        params.put("chatterUserCode", chatterUserCode);
        params.put("addConversationDate", today);
        return this.getSqlSession().selectOne(this.getStatement("getUserConversationNumEntity"), params);
    }
}